import * as React from 'react';
import {observer} from 'mobx-react'
import styles from './index.scss';
import {Carousel} from 'antd';
import SecondStore from '../../../../../store/secondStore'
import {IFinishType} from "../../../../../type/firstType";
import ModalText from "../../../../../components/ModalText";

interface IProps {
    unFinished: IFinishType[]
}

@observer
class Home extends React.Component<IProps> {

    constructor(props) {
        super(props);
    }


    public render() {
        const {unFinished} = this.props
        return (
            <div className={styles.swiper}>
                <div className={styles.title}>
                    <span className={styles.fixSpan}><ModalText text='设备序列号' long={20} /></span>
                    <span className={styles.spanWidth}><ModalText text='是否宕机' long={10} /></span>
                    <span className={styles.spanWidth}><ModalText text='技术员' long={10} /></span>
                    <span className={styles.fixSpan}><ModalText text='故障描述' long={20} /></span>
                </div>
                <div className={styles.swiperC}>
                    {
                        unFinished.length > 0 &&
                        <Carousel autoplay={true} dots={false} vertical={true} slidesToShow={6} autoplaySpeed={2000}>
                            {
                                unFinished.map((item, index) => {
                                    return (
                                        <div className={index % 2 === 0 ? styles.list1 : styles.list} key={`itemRSW_${index}`}>
                                            <span className={styles.fixSpan}><ModalText text={item.WorkOrderNumber}
                                                                                          long={20} /></span>
                                            <span className={styles.spanWidth}><ModalText text={item.IsSystemdown}
                                                                                          long={10} /></span>
                                            <span className={styles.spanWidth}><ModalText text={item.Technician}
                                                                                          long={10} /></span>
                                            <span className={styles.fixSpan}><ModalText
                                                text={item.InitialReportEnglish} long={20} /></span>
                                        </div>
                                    )
                                })
                            }
                        </Carousel>
                    }
                </div>
            </div>
        );
    }
}

export default Home;
